import { get, post } from '@/utils/request'

const prefix = 'activity'

export default {
  seckillConfig: () => {
    return get(`${prefix}/seckill/update`)
  },
  updateSeckill: data => {
    return post(`${prefix}/seckill/update`, data)
  },
  specialConfig: id => {
    return get(`${prefix}/special/update`, {
      id: id
    })
  },
  updateSpecial: (data, id) => {
    return post(`${prefix}/special/update?id=${id}`, data)
  },
  updateTimelimit: (data, id) => {
    return post(`${prefix}/timelimit/update?id=${id}`, data)
  },
  timelimitView: id => {
    return get(`${prefix}/timelimit/view?id=${id}`)
  },
  handle: (data, id) => {
    return post(`${prefix}/handle/update?id=${id}`, data)
  },
  optionalGoods: data => {
    return get(`${prefix}/goods/optional`, data)
  },
  addGoods: data => {
    return post(`${prefix}/goods/add`, data)
  },
  removeGoods: id => {
    return post(`${prefix}/goods/remove?id=${id}`)
  },
  updateGoods: (data, id) => {
    return post(`${prefix}/goods/update?id=${id}`, data)
  }
}
